16.11.2013, 23:51
Desenvolvi um cуdigo pra vocк, que compilou perfeitamente. Quanto ao funcionamento, cabe a vocк testar.
pawn Код:
CMD:dararmas(playerid, params[]) {
new targetid;
if(sscanf(params, "u", targetid)) {
return SendClientMessage(playerid, -1, "Uso: /dararmas <id>");
}
if(!IsPlayerConnected(targetid)) {
return SendClientMessage(playerid, -1, "Jogador offline.");
}
if(!getWeapons(playerid)) {
return SendClientMessage(playerid, -1, "Vocк estб desarmado.");
}
new x, w, a;
for(x = 0; x < 13; ++x) {
GetPlayerWeaponData(playerid, x, w, a);
if(w) {
GivePlayerWeapon(targetid, w, a);
}
}
new string[120];
GetPlayerName(playerid, string, 25);
format(string, sizeof string, "%s deu as armas dele pra vocк.", string);
SendClientMessage(targetid, -1, string);
GetPlayerName(targetid, string, 25);
format(string, sizeof string, "Vocк deu suas armas para %s.", string);
SendClientMessage(playerid, -1, string);
ResetPlayerWeapons(playerid);
return true;
}
getWeapons(playerid) {
new total = 0,
x, w, a;
for(x = 12; x > -1; --x) {
GetPlayerWeaponData(playerid, x, w, a);
if(x) {
++total;
}
}
return total;
}