23.12.2011, 08:41
Boas, eu editei aqui um comando que й de RolePlay, o comando й o /aj(adminjail), o que acontece й que no server quando faзo o comando /aj playerid minutos razгo, os minutos fica sempre em 0 e o numero de minutos que eu meti aparece na razгo.. agradecia uma ajudinha
Код:
if(strcmp(cmd, "/aj", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "[INFO:] /AJ [playerid] [minutos] [razгo]"); return 1; } new playa; new money; new id = strval(tmp); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); money = strval(tmp); if (PlayerInfo[playerid][pAdmin] >= 2) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { format(string, sizeof(string), "{8B0000}Mandas-te o jogador %s de AdminJail(AJ) durante %d minutos.", GetPlayerNameEx(playa),money); SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string); format(string, sizeof(string), "{8B0000}Foste parar б AdminJail(AJ), quem te mandou foi %s durante %d minutos.", GetPlayerNameEx(playerid),money); SendClientMessage(playa, COLOR_LIGHTYELLOW2, string); format(string, sizeof (string), "{68228B}O Jogador %s foi de AdminJail por %s durante %d minutos [Razгo: %s.]", GetPlayerNameEx(playerid), GetPlayerNameEx(id), money,(result)); SendClientMessageToAll(COLOR_WHITE, string); printf("%s",string); ResetPlayerWeapons(playa); WantedPoints[playa] = 0; PlayerInfo[playa][pJailed] = 1; PlayerInfo[playa][pJailTime] = money*60; SetPlayerInterior(playa, 6); SetPlayerPos(playa, 1278.3345,-806.2936,86.1230); SetPlayerVirtualWorld(playerid,2); } } } else { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "{8B0000}[ERRO:] Nгo йs administrador ou nгo tens nнvel suficiente de admin."); } } return 1; }