Szerző Téma: Ez miért nem jó?  (Megtekintve 453 alkalommal)

Ez miért nem jó?
« Dátum: 2012. Március 08. - 17:01:53 »
0 Show voters
A módomba van egy ilyen:
 
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == 523 ||427 || 490 || 497 || 425 || 520 || 528 ||596 || 598 || 597 || 599 || 432 || 601)
{
if(!IsPlayerLuxAdmin(playerid))
{
GameTextForPlayer(playerid,\"~r~Csak rend§r sz˜lhat be!\", 3000, 1);
ClearAnimations(playerid);
}
}
return 1;
}
stock IsPlayerLuxAdmin(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new file[256], tmp, tmp2;
format(file,256,\"/LuxAdmin/Accounts/%s.sav\",udb_encode(name));
tmp = dini_Int(file,\"Level\");
tmp2 = dini_Int(file,\"Loggedin\");
if( (IsPlayerConnected(playerid)) && (tmp > 0) && (tmp2 == 1) )
return true;
else return false;
}

 
Nos ez jó mert nem szálhat be a rendõr kocsiba az aki nem admin. de a civil kocsikba se szálhatnak be valamiért :S

Ez miért nem jó?
« Válasz #1 Dátum: 2012. Március 08. - 17:24:30 »
+1 Show voters

new VID;
VID=GetVehicleModel(vehicleid);
if(VID == 523 || VID == 427.........)

 
Tessék
Vagy
 

switch(VID)
{
case 523,427...:
{
if(!IsPlayerLuxAdmin(playerid))
{
GameTextForPlayer(playerid,\"~r~Csak rend§r szlhat be!\", 3000, 1);
ClearAnimations(playerid);
}
}
}
« Utoljára szerkesztve: 2012. Március 08. - 17:48:02 írta 1ST_Chr »

Ez miért nem jó?
« Válasz #2 Dátum: 2012. Március 08. - 17:52:57 »
0 Show voters
kösz megy a +! Mûködik.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal