11.08.2014, 17:53
I want to block entry to other players when they want to enter as a driver.
Код:
CMD:bmx(playerid, params[]) { if(Sklep[playerid][bmx] == 0) { GraczVeh = 1; new string[500]; new Gname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Gname, sizeof(Gname)); format(string, sizeof(string), "/Gracze/%s.ini",Gname); Sklep[playerid][bmx] = 1; dini_IntSet(string, "bmx", 1); SendClientMessage(playerid, C_CYAN, "Motion Of 3Run: {FFFFFF}Kupiles BMX'a"); }else{ new Index; new tmp2[256]; tmp2 = strtok(params,Index); new tmp3[256]; tmp3 = strtok(params,Index); if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]); GraczVeh = 1; new colour1, colour2; if(!strlen(tmp2)) colour1 = random(256); else colour1 = strval(tmp2); if(!strlen(tmp3)) colour2 = random(256); else colour2 = strval(tmp3); new Float:X,Float:Y,Float:Z; new Float:Angle; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); if(PrivateVehicles[playerid] != 0) DestroyVehicle(PrivateVehicles[playerid]); PrivateVehicles[playerid] = CreateVehicle(481, X+0,Y,Z, Angle, colour1, colour2, -1); PlayerPlaySound(playerid,1085,0,0,0); PutPlayerInVehicle(playerid,PrivateVehicles[playerid],0); } return 1; }
Код:
{ if(// if not this player this vehicle) { ShowPlayerLangDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Prywatny Pojazd", "Private Vehicle", "To nie twoj pojazd!\nMozesz kupic wlasny pod komenda /sklep", "This is not your vehicle\nBuy vehicles in /sklep", "Wyjdz", "Exit", "",""); ClearAnimations(playerid); return 1; } return 1; }