Page 1 of 1

Kā lai uzliek ka var aizslēgt tikai vienu mašīnu.?

Posted: 21 Feb 2010, 09:00
by SiiPols
Te ir LOCK, UNLOCK skripts

Code: Select all

		if(!strcmp(cmdtext,"/lock",true,5)) {
  	    new carid;
   		if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid)==PLAYER_STATE_DRIVER) {
   		    GameTextForPlayer(playerid,"~r~LOCKED!",100,1);
      		carid=GetPlayerVehicleID(playerid);
      		new i;
      		for (i=0;i<MAX_PLAYERS;i++){
        		if (i!=playerid) SetVehicleParamsForPlayer(carid,i,0,1);
    		}
    		return 1;
  		}
  		else
  		{
  		    SendClientMessage(playerid, COLOR_ERROR, "Tev jāatrodas mašīnā lai izmantotu šo kommandu!");
  		    return 1;
		}

  	}

if(!strcmp(cmdtext,"/unlock",true,7)) {
  	    new carid;
   		if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid)==PLAYER_STATE_DRIVER) {
      		carid=GetPlayerVehicleID(playerid);
			GameTextForPlayer(playerid,"~g~UNLOCKED!",100,1);
      		new i;
      		for (i=0;i<MAX_PLAYERS;i++){
	if (i!=playerid) SetVehicleParamsForPlayer(carid,i,0,0);
    		}
    		return 1;
  		}
  		else
  		{
  		    SendClientMessage(playerid, COLOR_ERROR, "Tev jāatrodas mašīnā lai izmantotu šo kommandu!");
  		    return 1;
		}
  	}