03.03.2012, 00:13
Your command was a little messy and else statement smack in the middle made the command stop processing.
You should add your else statement at the end of everything like so.
So move this
at the end of the command, so it should look like this.
You should add your else statement at the end of everything like so.
So move this
pawn Код:
else SendClientMessage(playerid, COLOR_RED,"You're not admin!");
pawn Код:
if(strcmp(cmdtext, "/delveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /delveh");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >=2)
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
format(string, sizeof(string), "*%d Admin %s: Deleted the vehicle", PlayerInfo[playerid][pAdmin], sendername);
SendAdminMessage(COLOR_YELLOW,string);
printf("Admin %s: Deleted the vehicle", sendername);
SendClientMessage(playerid, COLOR_GRAD1,"Vehicle deleted!");
return 1;
}
else
{
return SendClientMessage(playerid, COLOR_RED,"You're not admin!");
}
}
return 1;
}