CMD:courier(playerid,params[])
{
if(Corriere[playerid] == 1) return SendClientMessage(playerid, BIANCO, "You are already in courier mission!");
{
StatoCorriere[playerid]=1;
Corriere[playerid]=1;
NienteGod[playerid]=1;
GodTemp[playerid]=1;
VeicoliNo[playerid]=1;
VeicoliNo2[playerid]=1;
DisabilitaBoost[playerid]=1;
SetPlayerHealth(playerid, 100);
SetPlayerCheckpoint(playerid,1110.5992,-1327.9216,13.7145,10);
new nome[MAX_PLAYER_NAME], stringa[48];
GetPlayerName(playerid, nome, sizeof(nome));
format(stringa, sizeof(stringa), "%s is now a Courier", nome);
SendClientMessageToAll(GIALLO, stringa);
}
else // This is the error line <<<<<<<<<<---------
{
SendClientMessage(playerid, ROSSO,"You have to be in a courier truck to start the job! (Type /v benson");
SendClientMessage(playerid, ROSSO,"and then type again /courier)");
}
return 1;
}
CMD:courier(playerid,params[])
{
if(Corriere[playerid] == 1)
{
StatoCorriere[playerid]=1;
Corriere[playerid]=1;
NienteGod[playerid]=1;
GodTemp[playerid]=1;
VeicoliNo[playerid]=1;
VeicoliNo2[playerid]=1;
DisabilitaBoost[playerid]=1;
SetPlayerHealth(playerid, 100);
SetPlayerCheckpoint(playerid,1110.5992,-1327.9216,13.7145,10);
new nome[MAX_PLAYER_NAME], stringa[48];
GetPlayerName(playerid, nome, sizeof(nome));
format(stringa, sizeof(stringa), "%s is now a Courier", nome);
SendClientMessageToAll(GIALLO, stringa);
}
else // This is the error line <<<<<<<<<<---------
{
SendClientMessage(playerid, ROSSO,"You have to be in a courier truck to start the job! (Type /v benson");
SendClientMessage(playerid, ROSSO,"and then type again /courier)");
}
return 1;
}
CMD:courier(playerid,params[])
{
if(Corriere[playerid] != 1)
{
StatoCorriere[playerid]=1;
Corriere[playerid]=1;
NienteGod[playerid]=1;
GodTemp[playerid]=1;
VeicoliNo[playerid]=1;
VeicoliNo2[playerid]=1;
DisabilitaBoost[playerid]=1;
SetPlayerHealth(playerid, 100);
SetPlayerCheckpoint(playerid,1110.5992,-1327.9216,13.7145,10);
new nome[MAX_PLAYER_NAME], stringa[48];
GetPlayerName(playerid, nome, sizeof(nome));
format(stringa, sizeof(stringa), "%s is now a Courier", nome);
SendClientMessageToAll(GIALLO, stringa);
}
else if(Corriere[playerid] == 1) return SendClientMessage(playerid, BIANCO, "You are already in courier mission!");
else
{
SendClientMessage(playerid, ROSSO,"You have to be in a courier truck to start the job! (Type /v benson");
SendClientMessage(playerid, ROSSO,"and then type again /courier)");
}
return 1;
}
|
This
pawn Код:
|
if(Corriere[playerid] == 1) return SendClientMessage(playerid, -1, "You need to be a courier...");
//Will only execute when Corriere[playerid] is 1.
if(Corriere[playerid] != 1)
CMD:courier(playerid,params[])
{
if(Corriere[playerid] != 1)
{
StatoCorriere[playerid]=1;
Corriere[playerid]=1;
NienteGod[playerid]=1;
GodTemp[playerid]=1;
VeicoliNo[playerid]=1;
VeicoliNo2[playerid]=1;
DisabilitaBoost[playerid]=1;
SetPlayerHealth(playerid, 100);
SetPlayerCheckpoint(playerid,1110.5992,-1327.9216,13.7145,10);
new nome[MAX_PLAYER_NAME], stringa[48];
GetPlayerName(playerid, nome, sizeof(nome));
format(stringa, sizeof(stringa), "%s is now a Courier", nome);
SendClientMessageToAll(GIALLO, stringa);
}
else // This is the error line <<<<<<<<<<---------
{
SendClientMessage(playerid, ROSSO,"You have to be in a courier truck to start the job! (Type /v benson");
SendClientMessage(playerid, ROSSO,"and then type again /courier)");
}
return 1;
}
|
To be simple, it goes through to check if its equal to , If its equal to one then it returns a client message, if not there's a case with else if to send its client message and if its not any of the both then it sends the messages at the bottom, wont mess at all. I even learnt this in my classes.
|