Posts: 77
Threads: 23
Joined: Aug 2012
Reputation:
0
How can i made this command:
if(strcmp(cmdtext,"/buygun",true)==0)
{
if(IsPlayerInRangeOfPoint(playerid,5, 1995.9645996094, -1199.5222167969, 19.05354309082))
{
ShowPlayerDialog(playerid, DIALOG_GUN, DIALOG_STYLE_LIST, "Gun Shop", "Deagle - 1000$\n Shotgun - 2500$\n M4A1 - 5000$\n AK47 - 5000$\n Sniper 3000$\n Granade - 1000$\n RPG - 15000$\n Armor - 2500$", "Buy", "Cancel");
}
else
{
SendClientMessage(playerid,0x0000BBAA,"You are not at the gunplace!");
}
return 1;
}
to be used ONLY if u are in car ID 440? otherwise u get an message
Posts: 632
Threads: 24
Joined: Aug 2011
pawn Код:
if(strcmp(cmdtext,"/buygun",true)==0)
{
if(GetPlayerVehicleId(playerid) != 440)) return SendClientMessage(playerid,color, "message");
if(IsPlayerInRangeOfPoint(playerid,5, 1995.9645996094, -1199.5222167969, 19.05354309082))
{
ShowPlayerDialog(playerid, DIALOG_GUN, DIALOG_STYLE_LIST, "Gun Shop", "Deagle - 1000$\n Shotgun - 2500$\n M4A1 - 5000$\n AK47 - 5000$\n Sniper 3000$\n Granade - 1000$\n RPG - 15000$\n Armor - 2500$", "Buy", "Cancel");
}
else
{
SendClientMessage(playerid,0x0000BBAA,"You are not at the gunplace!");
}
return 1;
}
Try that, not sure if I used GetPlayerVehicleID right since I never scripted smthing to check the vehicle ID, hope it works.
EDIT: If you want it to be used in the vehicle at any location, do this:
pawn Код:
if(strcmp(cmdtext,"/buygun",true)==0)
{
if(GetPlayerVehicleId(playerid) == 440))
{
ShowPlayerDialog(playerid, DIALOG_GUN, DIALOG_STYLE_LIST, "Gun Shop", "Deagle - 1000$\n Shotgun - 2500$\n M4A1 - 5000$\n AK47 - 5000$\n Sniper 3000$\n Granade - 1000$\n RPG - 15000$\n Armor - 2500$", "Buy", "Cancel");
}
else
{
SendClientMessage(playerid,0x0000BBAA,"You are not at the gunplace!");
}
return 1;
}
Posts: 77
Threads: 23
Joined: Aug 2012
Reputation:
0
i get this:
C:\Users\DELL\Desktop\TDM v0.3\gamemodes\tdm.pwn(405) : error 017: undefined symbol "GetPlayerVehicleId"
C:\Users\DELL\Desktop\TDM v0.3\gamemodes\tdm.pwn(405) : error 029: invalid expression, assumed zero
C:\Users\DELL\Desktop\TDM v0.3\gamemodes\tdm.pwn(405) : warning 215: expression has no effect
C:\Users\DELL\Desktop\TDM v0.3\gamemodes\tdm.pwn(405) : error 001: expected token: ";", but found "return"
C:\Users\DELL\Desktop\TDM v0.3\gamemodes\tdm.pwn(405) : fatal error 107: too many error messages on one line
Posts: 98
Threads: 7
Joined: Feb 2012
Reputation:
0
@TomatoRage wtf are u doing? Learn Pawn before you write such a wrong code, my code works 100% it's tested so don't edit anything and write "Fixed".