I have a problem, help please.
#1

Hello, i created a command /eject, it throws out a person out of a car, it works fine. There is a problem that i can't fix, if i just write /eject it reads the ID of player as 0... How do i fix it?

Here's the script:
Код:
COMMAND:eject(playerid, params[])
{
  new zaidejoid;
  if(ALygis[playerid] >= 1)
  {
  	if(sscanf(params,"u",zaidejoid))
  	{
    	SendClientMessage(playerid,orandzine,"{FBDF89}[FunZoneLT]>> /eject [zaidejoid]");
  	}
    else
	{
	    if(!IsPlayerConnected(zaidejoid)) return SendClientMessage(playerid, raudona, "[FunZoneLT]>> Tokio zaidejo nera.");
	}
    if(IsPlayerInAnyVehicle(zaidejoid))
    {
		new string[100], zvardas[MAX_PLAYER_NAME], vardas[MAX_PLAYER_NAME];
		GetPlayerName(zaidejoid, zvardas, sizeof(zvardas));
		GetPlayerName(playerid, vardas, sizeof(vardas));
		format(string, sizeof(string), "[FunZoneLT]>> Tu ismetei, %s is masinos.", zvardas);
		SendClientMessage(playerid, COLOR_LIMEGREEN, string);
		format(string, sizeof(string), "[FunZoneLT]>> Tave ismete is masinos %s.", vardas);
		SendClientMessage(zaidejoid, COLOR_LIMEGREEN, string);
		RemovePlayerFromVehicle(zaidejoid);
    }
    else
	{
 		SendClientMessage(playerid, raudona, "[FunZoneLT]>> Zaidejas ne masinoje!");
    }
  }
  else
  {
    SendClientMessage(playerid,raudona,"[FunZoneLT]>> Jus negalite naudoti sitos komandos.");
  }
  return 1;
}
Help please.
Reply
#2

pawn Код:
COMMAND:eject(playerid, params[])
{
    if(ALygis[playerid] < 1) return SendClientMessage(playerid,raudona,"[FunZoneLT]>> Jus negalite naudoti sitos komandos.");
    new zaidejoid;
    if(sscanf(params,"u",zaidejoid)) return SendClientMessage(playerid,orandzine,"{FBDF89}[FunZoneLT]>> /eject [zaidejoid]");
    if(!IsPlayerConnected(zaidejoid)) return SendClientMessage(playerid, raudona, "[FunZoneLT]>> Tokio zaidejo nera.");
    if(!IsPlayerInAnyVehicle(zaidejoid)) return SendClientMessage(playerid, raudona, "[FunZoneLT]>> Zaidejas ne masinoje!");
    new string[100], zvardas[MAX_PLAYER_NAME], vardas[MAX_PLAYER_NAME];
    GetPlayerName(zaidejoid, zvardas, sizeof(zvardas));
    GetPlayerName(playerid, vardas, sizeof(vardas));
    format(string, sizeof(string), "[FunZoneLT]>> Tu ismetei, %s is masinos.", zvardas);
    SendClientMessage(playerid, COLOR_LIMEGREEN, string);
    format(string, sizeof(string), "[FunZoneLT]>> Tave ismete is masinos %s.", vardas);
    SendClientMessage(zaidejoid, COLOR_LIMEGREEN, string);
    RemovePlayerFromVehicle(zaidejoid);
    return 1;
}
Reply
#3

pawn Код:
COMMAND:eject(playerid, params[])
{
 
    if(ALygis[playerid] >= 1)
        return SendClientMessage(playerid,raudona,"[FunZoneLT]>> Jus negalite naudoti sitos komandos."), false;
    static zaidejoid;
    if(sscanf(params,"u",zaidejoid))
        return SendClientMessage(playerid,orandzine,"{FBDF89}[FunZoneLT]>> /eject [zaidejoid]"), false;
       
    if(!IsPlayerConnected(zaidejoid))
            return SendClientMessage(playerid, raudona, "[FunZoneLT]>> Tokio zaidejo nera."), false;
           
    if(!IsPlayerInAnyVehicle(zaidejoid)) return SendClientMessage(playerid, raudona, "[FunZoneLT]>> Zaidejas ne masinoje!"), false;
   
    static string[100], zvardas[MAX_PLAYER_NAME], vardas[MAX_PLAYER_NAME];
    GetPlayerName(zaidejoid, zvardas, sizeof(zvardas));
    GetPlayerName(playerid, vardas, sizeof(vardas));
    format(string, sizeof(string), "[FunZoneLT]>> Tu ismetei, %s is masinos.", zvardas);
    SendClientMessage(playerid, COLOR_LIMEGREEN, string);
    format(string, sizeof(string), "[FunZoneLT]>> Tave ismete is masinos %s.", vardas);
    SendClientMessage(zaidejoid, COLOR_LIMEGREEN, string);
    RemovePlayerFromVehicle(zaidejoid);
    return 0xA-9;
}
static is best of new.
Reply
#4

Thank you guys, and i have one last question. How can i make that when i removeplayerfrom vehicle he would appear on cars roof?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)