// I use this in a timer
new tmpcar = GetPlayerVehicleID(playerid);
if(!IsAShamal(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"You are not in a shamal.");
// I use this in a timer
new tmpcar = GetPlayerVehicleID(playerid);
if(!IsAShamal(tmpcar) || !IsAnAndromada(tmpcar)) return SendClientMessage(playerid,COLOR_WHITE,"You are not in a shamal or in a Andromada.");
if((!IsAShamal(tmpcar)) || (!IsAnAndromada(tmpcar))) return SendClientMessage(playerid,COLOR_WHITE,"You are not in a shamal or in a Andromada.");
|
Originally Posted by 0rb
That isn't a bug. Replace || by &&.
|
|
Originally Posted by Martins342
pawn Код:
|
|
Originally Posted by gamer_Z
lol if && then the player MUST BE in a shamal and andromeda at a time.....
BTW where you have GetPlayerVehicleID(playerid); use GetVehicleModel(GetPlayerVehicleID(playerid)); |
// I use this in a timer
new tmpcar = GetPlayerVehicleID(playerid);
if(!IsAShamal(tmpcar) && !IsAnAndromada(tmpcar)) return SendClientMessage(playerid,COLOR_WHITE,"You are not in a shamal or in a Andromada.");
// I use this in a timer
new tmpcar = GetPlayerVehicleID(playerid);
if(IsAShamal(tmpcar) || IsAnAndromada(tmpcar))
{
// Code here
} else return SendClientMessage(playerid,COLOR_WHITE,"You are not in a shamal or in a Andromada.");
|
Originally Posted by Lavamike
Quote:
The goal is to only continue if they are in a shamal or a andromada. Idk how to explain it but it makes sence when you think about it... You could do: pawn Код:
or you could do: pawn Код:
Both should work in theory |
if(!dini_Exists(udb_encode(PlayerName(playerid))) && LoggedIn[playerid] == 1)// if playerfile doesn't exist AND player is logged in.
{
dini_Create(udb_encode(PlayerName(playerid)));
dini_IntSet(udb_encode(PlayerName(playerid)), "score", GetPlayerScore(playerid));
dini_IntSet(udb_encode(PlayerName(playerid)), "skin", GetPlayerSkin(playerid));
LoggedIn[playerid] = 0;
SetPlayerScore(playerid,0);
return 1;
}
if(!dini_Exists(udb_encode(PlayerName(playerid))) || LoggedIn[playerid] == 1)// if playerfile doesn't exist OR player is logged in, this could probably crash.
{
dini_Create(udb_encode(PlayerName(playerid)));
dini_IntSet(udb_encode(PlayerName(playerid)), "score", GetPlayerScore(playerid));
dini_IntSet(udb_encode(PlayerName(playerid)), "skin", GetPlayerSkin(playerid));
LoggedIn[playerid] = 0;
SetPlayerScore(playerid,0);
return 1;
}
IsAShamal
{
switch(model)
{
case 519:return 1;
}
return 0;
}
IsAndromada
{
switch(model)
{
case 592:return 1;
}
return 0;
}
new tmpcar = GetPlayerModel(GetPlayerVehicleID(playerid));
if(!IsAShamal(tmpcar) || !IsAnAndromada(tmpcar)) return SendClientMessage(playerid,COLOR_WHITE,"You are not in a shamal or in a Andromada.");
IsWantedPlane
{
switch(model)
{
case 519:return 1;
case 592:return 1;
}
return 0;
}
new tmpcar = GetPlayerModel(GetPlayerVehicleID(playerid));
if(!IsWantedPlane(tmpcar)) return SendClientMessage(playerid,COLOR_WHITE,"You are not in a shamal or in a Andromada.");
|
Originally Posted by gamer_Z
lol if && then the player MUST BE in a shamal and andromeda at a time.....
BTW where you have GetPlayerVehicleID(playerid); use GetVehicleModel(GetPlayerVehicleID(playerid)); so leave the || @ Quote:
@ Quote:
|
IsWantedPlane{
switch(model){
case 519:return 1;//shamal
case 592:return 1;//andromada
}
return 0;
}
new tmpcar = GetPlayerModel(GetPlayerVehicleID(playerid));
if(IsWantedPlane(tmpcar)){//yeah lavamike has als a good solution in combination with mine so it's the ultimate solution xD
// Code here
} else return SendClientMessage(playerid,COLOR_WHITE,"You are not in a shamal or in a Andromada.");
