if (strcmp("/startconvoy", cmdtext, true, 10) == 0) { new playername[MAX_PLAYER_NAME], msg[128]; GetPlayerName(playerid, playername, MAX_PLAYER_NAME); format(msg, sizeof(msg), "%s wants to start a convoy type /joinconvoy if you want to join them ", playername); SendClientMessageToAll(COLOR_YELLOW,msg); return 1; } if (strcmp("/joinvconvoy", cmdtext, true, 10) == 0) SendClientMessage(playerid,COLOR_YELLOW,"you have joined the convoy. Go to Sf carrier to join %s. " return 0; }
if(GetVehicleModel(GetPlayerVehicleID(playerid))==433||GetVehicleModel(GetPlayerVehicleID(playerid))==432||GetVehicleModel(GetPlayerVehicleID(playerid))==425)
if(strcmp("/startvconvoy", cmdtext, true, 10) == 0) { if(GetVehicleModel(GetPlayerVehicleID(playerid))==433||GetVehicleModel(GetPlayerVehicleID(playerid))==432||GetVehicleModel(GetPlayerVehicleID(playerid))==425) { new playername[MAX_PLAYER_NAME], msg[128]; GetPlayerName(playerid, playername, MAX_PLAYER_NAME); format(msg, sizeof(msg), "%s wants to start a convoy type /joinconvoy if you want to join them ", playername); SendClientMessageToAll(COLOR_YELLOW,msg); return 1; } else { SendClientMessage(playerid,COLOR_YELLOW,"You cannot start the convoy with this vehicle. " return 1; } }
if(!strcmp(cmdtext, "/startconvoy", true))
{
new vehicle = GetVehicleModel(GetPlayerVehicleID(playerid));
if(vehicle != 433 && vehicle != 432 && vehicle != 425)
{
SendClientMessage(playerid, COLOR_YELLOW, "You cannot start the convoy with this vehicle!");
return true;
}
new PlayerName[MAX_PLAYER_NAME],
msg[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(msg, sizeof(msg), "%s(%i) wants to start a convoy! Type /joinconvoy to join them!", PlayerName, playerid);
SendClientMessageToAll(COLOR_YELLOW, msg);
return true;
}
if( ( V( playerid,433 ) || V( playerid, 432 ) || V( playerid, 425 ) ) )
{
// Code
}
else
{
return SendClientMessage(playerid, COLOR_YELLOW, "You cannot start the convoy with this vehicle!");
}
return 1;
}
Originally Posted by Frankylez
gamestar, won't that still call GetVehicleModel() and GetPlayerVehicleID() 3 times in that command?
|