23.05.2011, 14:34
Is this fully converted strcmp to zcmd or I can do more?:
pawn Код:
command(object, playerid, params[])
{
new idx;
if(IsPlayerConnected(playerid)) {
new x_nr[24];
x_nr = strtok(params, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_GREY, "USAGE: /object [package, bc, delete]");
SendClientMessage(playerid, COLOR_GREY, "USE: \"delete\" will remove the item from your body!");
return 1;
}
if(strcmp(x_nr,"package",true) == 0) {
AttachObjectCorrectly(playerid, 3026);
}
else if(strcmp(x_nr,"bc",true) == 0) {
AttachObjectCorrectly(playerid, 1210);
}
else if(strcmp(x_nr,"delete",true) == 0) {
RemovePlayerAttachedObject(playerid,3);
if(IsACop(playerid) && PlayerInfo[playerid][pDuty] == 1) {
if(Tazer[playerid] == 1) {
AttachWeaponCorrectly(playerid, 24);
}
else {
AttachWeaponCorrectly(playerid, 23);
}
}
}
else return SendClientMessage(playerid, COLOR_GREY,"* Unknown item!");
}
return 1;
}