#include <a_samp>
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_YELLOW 0xFFFF00AA
public OnGameModeInit() {
SetGameModeText("NICHTS ^^");
AddPlayerClass(0,1218.0123,-936.9485,42.6448,1.2530,0,0,0,0,0,0);
return 1;
}
stock GetPlayerIDFromName(name[]) {
new plname[MAX_PLAYER_NAME];
for(new i=0; i<MAX_PLAYERS; i++) {
GetPlayerName(i, plname, sizeof(plname));
if(!strcmp(name, plname, true)) {
return i;
}
}
return INVALID_PLAYER_ID;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
new cmd[256], idx, fn[256], sn[256], nameid;
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd, "/rename", true)) {
fn = strtok(cmdtext, idx);
sn = strtok(cmdtext, idx);
if(!strlen(fn) || !strlen(sn)) return SendClientMessage(playerid, 0x00FF00FF, "/rename [player name] [new name]");
nameid = GetPlayerIDFromName(fn);
if(!IsPlayerConnected(nameid)) return SendClientMessage(playerid, 0x00FF00FF, "Playerid isn't connected!");
SetPlayerName(nameid, sn);
SendClientMessage(playerid, 0x00FF00FF, "Name succesfully changed");
return 1;
}
return 0;
}
So lässt sich das compilieren, eventuell brauchst du noch die strtok() Funktion .