cmd doesnt work - 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)
+--- Thread: cmd doesnt work (
/showthread.php?tid=429689)
cmd doesnt work -
yaron0600 - 10.04.2013
When I'm at the pickup and do the /getdeliver this is not working what to do ? This is the cmd code , try fix that please :
Код:
CMD:getdeliver(playerid, params[])
{
if (PlayerInfo[playerid][pJob] != 0 && PlayerInfo[playerid][pJob2] != 0)
{
SendClientMessageEx(playerid,COLOR_GREY," You are not working in other job already [For work for that /quitjob]");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(!(IsADeliverCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
SendClientMessageEx(playerid,COLOR_GREY," You need to be driving a Deliver in Deliver Truck!");
return 1;
}
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (!IsPlayerInRangeOfPoint(playerid, 0, 2993.46, 472.90, 2.26))
{
SendClientMessageEx(playerid,COLOR_GREY," You are not at the Delivering pickup!");
return 1;
}
if(GetPVarInt(playerid, "Delivering") > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are already delivering the illeagel stuff!");
return 1;
}
{
SetPlayerCheckpoint(playerid, 2784.85, -2455.96, 13.63, 3.0);
return 1;
}
new szMessage[128];
format(szMessage, sizeof(szMessage), "You have picked up the Deliver for SPAS-12 Weapon! ");
SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
GivePlayerWeapon(playerid, 27, 999999);
for(new i = 1; i <= MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
return 1;
}
Re: cmd doesnt work -
Scenario - 10.04.2013
Proper indentation is key when writing code. If you would have indented that code properly, you would of seen your mistake! See if you can't find it now:
pawn Код:
CMD:getdeliver(playerid, params[])
{
if (PlayerInfo[playerid][pJob] != 0 && PlayerInfo[playerid][pJob2] != 0)
{
SendClientMessageEx(playerid,COLOR_GREY," You are not working in other job already [For work for that /quitjob]");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(!(IsADeliverCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
SendClientMessageEx(playerid,COLOR_GREY," You need to be driving a Deliver in Deliver Truck!");
return 1;
}
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (!IsPlayerInRangeOfPoint(playerid, 0, 2993.46, 472.90, 2.26))
{
SendClientMessageEx(playerid,COLOR_GREY," You are not at the Delivering pickup!");
return 1;
}
if(GetPVarInt(playerid, "Delivering") > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are already delivering the illeagel stuff!");
return 1;
}
{
SetPlayerCheckpoint(playerid, 2784.85, -2455.96, 13.63, 3.0);
return 1;
}
new szMessage[128];
format(szMessage, sizeof(szMessage), "You have picked up the Deliver for SPAS-12 Weapon! ");
SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
GivePlayerWeapon(playerid, 27, 999999);
for(new i = 1; i <= MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
return 1;
}
Re: cmd doesnt work - Patrick - 10.04.2013
Hint
This Part of Code where your error that command might not work
pawn Код:
if(GetPVarInt(playerid, "Delivering") > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are already delivering the illeagel stuff!");
return 1;
}
{
SetPlayerCheckpoint(playerid, 2784.85, -2455.96, 13.63, 3.0);
return 1;
}
What did you forgot?
Re: cmd doesnt work -
yaron0600 - 11.04.2013
The part is that !
Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (!IsPlayerInRangeOfPoint(playerid, 0, 2993.46, 472.90, 2.26))
{
SendClientMessageEx(playerid,COLOR_GREY," You are not at the Delivering pickup!");
return 1;
}
Cause this is the message I get when I'm in those positions excatly...