23.03.2010, 17:31
When I am trying to explode id:1 or w/e it's says: Invalid ID. :P How to fix this?
The only things I fixed on the v-admin are jetpack and godoff :P
Код:
if(strcmp(cmd, "/explode", true) == 0) { if(PlayerInfo[playerid][pAdmin] < 4) return DenyMessage(playerid, 4); tmp = strtok(cmdtext, idx); giveplayerid = ReturnUser(tmp); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /explode [playerid/PartOfName] [reason]"); if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You can't blow-up a higher level Admin !"); if(giveplayerid != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID."); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /explode [playerid/PartOfName] [reason]"); new Float:X,Float:Y,Float:Z; if(!IsPlayerInAnyVehicle(giveplayerid)) { format(string, sizeof(string), "\"%s\" was blown-up by Admin \"%s\". Reason: (%s)", giveplayer, sendername, (result)); SendClientMessageToAll(COLOR_YELLOW, string); GetPlayerPos(giveplayerid, X, Y, Z); CreateExplosion(X, Y, Z, 10, 15.0); SetPlayerHealth(giveplayerid, 0); } else { format(string, sizeof(string), "\"%s\" was blown-up by Admin \"%s\". Reason: (%s)", giveplayer, sendername, (result)); SendClientMessageToAll(COLOR_YELLOW, string); GetVehiclePos(GetPlayerVehicleID(giveplayerid), X, Y, Z); CreateExplosion(X, Y, Z, 4, 10.0); } return 1; }