take off - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: take off (
/showthread.php?tid=122995)
take off -
turismo3591 - 24.01.2010
hello do u can help me please if u are paypal i pay 2 dollar for this script
when person type /takeoff it check if person in plane then send yellow message to everyone and say "username taking off!".
Re: take off -
Lajko1 - 24.01.2010
amm can u tell more informations and explain bit more and there will be some help
cuz actualy i dont understand what u want
Re: take off -
mansonh - 24.01.2010
I know what you want i think, i don't need money for such a simple piece of code.
This uses the dcmd system, so just add this line to the top of your script:
dcmd def
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(takeoff, 7, cmdtext);
return 0;
}
dcmd_takeoff(playerid, params[])
{
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513:
{
new msg[128], name[24];
GetPlayerName(playerid, name, sizeof (name));
format(msg,sizeof(msg), "%s taking off", name);
SendClientMessageToAll(0xEEEE00FF, msg);
}
default: SendClientMessage(playerid,0xEEEE00FF, "You are not in a plane, you cannot take off");
}
}
Re: take off -
jonrb - 24.01.2010
Quote:
Originally Posted by mansonh
I know what you want i think, i don't need money for such a simple piece of code.
This uses the dcmd system, so just add this line to the top of your script: dcmd def
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(takeoff, 7, cmdtext); return 0; } dcmd_takeoff(playerid, params[]) { switch(GetVehicleModel(GetPlayerVehicleID(playerid))) { case 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513: { new msg[128], name[24]; GetPlayerName(playerid, name, sizeof (name)); format(msg,sizeof(msg), "%s taking off", name); SendClientMessageToAll(0xEEEE00FF, msg); } default: SendClientMessage(playerid,0xEEEE00FF, "You are not in a plane, you cannot take off"); } }
|
He's right.
You might want to add "#pragma unused params" or just use if(!strcmp(cmdtext,"/takeoff)) instead of dcmd
Re: take off -
`FuTuRe- - 24.01.2010
Just edit a bit and it should work
pawn Код:
dcmd_takeoff(playerid, params[])
{
#pragma unused params
new string[128];
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid) && !IsAirVehicle(vehicle))return SendMsg(playerid,5000,"~r~[ERROR] ~w~You have to be in a plane to takeoff!");
if(GetPlayerTeam(playerid) == TEAM_LS)SendClientMessage(playerid, COLOR_BLUE, "~g~[RADIO LS] ~w~Request to takeoff accepted!");
if(GetPlayerTeam(playerid) == TEAM_LS)format(string,sizeof(string),"[RADIO LS] %s is taking of! Please clear runways!",pInfo[playerid][name]);
if(GetPlayerTeam(playerid) == TEAM_LV)SendMsg(playerid, 5000, "~p~[RADIO LV] ~w~Request to takeoff accepted!");
if(GetPlayerTeam(playerid) == TEAM_LV)format(string,sizeof(string),"[RADIO LV] %s is taking of! Please clear runways!",pInfo[playerid][name]);
for (new i=0; i<MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && i!=playerid)
{
if(GetPlayerTeam(i) == GetPlayerTeam(playerid))SendClientMessage(i, COLOR_GREY, string);
}
}
return 1;
}
Re: take off -
mansonh - 24.01.2010
Quote:
Originally Posted by `FuTuRe-
Just edit a bit and it should work
|
He didn't ask anything about teams, why are you adding teams?