19.06.2015, 13:32
When i execute the command server says "unknown command" but it's working, but it read wrong the parameterers, i don't need a user id. If i type /setvw 0 the command set me (playerid) virtualworld 0, why it's doing that? What can be wrong?
Код:
if(strcmp(cmd, "/setvw", true) == 0) { if(IsPlayerConnected(playerid)) { if(gLogged[playerid] == 1) { if (PlayerInfo[playerid][pAdmin] >= 1) { new in; temp = strtok(cmdtext, idx); if(!strlen(temp)) { SendClientMessage(playerid, COLOR_SYN, "Synthax: /setvw <playerid/PartOfName> <vw>"); return 1; } targetid = ReturnUser(temp); temp = strtok(cmdtext, idx); in = strval(temp); if(IsPlayerConnected(targetid)) { if(targetid != INVALID_PLAYER_ID) { GetPlayerName(playerid, pName, sizeof(pName)); GetPlayerName(targetid, pNameGive, sizeof(pNameGive)); SetPlayerVirtualWorld(targetid, in); format(string, sizeof(string), "Adminul %s i-a setat lui %s virtualworld %d.", pName,pNameGive,in); SCMAdmins(string); format(string, sizeof(string), "Adminul %s ti-a setat virtualworld %d.", pName,in); SendClientMessage(playerid, COLOR_LIGHTRED2, string); return 1; } } } } } return 1; }