Originally Posted by ┤ŞąiBЄЯҒПŋ├
pawn Код:
if (strcmp("/pinfo", cmdtext, true, 10) == 0) { new strs[256],IP[20]; GetPlayerIP(playerid,IP,sizeof(IP)); format(strs,sizeof(strs),"Money: %d Health: %f Armour: %f IP: %s",GetPlayerMoney(playerid),GetPlayerHealth(playerid),GetPlayerArmour(playerid),IP); return 1; }
without strtok
and with strtok:
pawn Код:
if(strcmp(cmd, "/pinfo", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) //If nothing is typed in behind /pinfo { SendClientMessage(playerid, YOURCOLOR, "USAGE: /pInfo [playerid]"); SendClientMessage(playerid, YOURCOLOR, "FUNCTION: View player's stats."); return 1; } new giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid))//If the player is connected { new sstring[90]; new ip[20]; GetPlayerIp(giveplayerid, ip, sizeof ip); GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); format(sstring, sizeof(sstring), "%s's IP: %s Money: %d Health: %f Armour: %f", giveplayername,ip,GetPlayerMoney(playerid),GetPlayerHealth(playerid),GetPlayerArmour(playerid)); SendClientMessage(playerid,YOURCOLOR, sstring); } else //If he ain't connected { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, YOURCOLOR, string); } return 1; }
|