Need small help for cmd - 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: Need small help for cmd (
/showthread.php?tid=355353)
Need small help for cmd -
kaiks - 29.06.2012
Need small help to correct this, because it seems like it's working fine, but actually
it doesn't work fine.
pawn Код:
if(strcmp(cmdtext, "/work", true) == 0)
{
if(gTeam[playerid] != 2) return SendClientMessage(playerid, COLOR_GREY, "You're not the carrier");
}
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
{
if(gTeam[playerid] == 2)
SendClientMessage(playerid, COLOR_GREY, "You've started the job, go and pick up the goods");
Ccp[playerid] = 1;
SetPlayerCheckpoint(playerid,120.403518, -294.375122, 1.578125, 3.0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not in the truck!");
return 1;
}
return 1;
}
Re: Need small help for cmd -
WagnerPM - 29.06.2012
pawn Код:
if(strcmp(cmdtext, "/work", true) == 0)
{
if(gTeam[playerid] != 2)
return SendClientMessage(playerid, COLOR_GREY, "You're not the carrier");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 440)
{
if(gTeam[playerid] == 2)
SendClientMessage(playerid, COLOR_GREY, "You've started the job, go and pick up the goods");
Ccp[playerid] = 1;
SetPlayerCheckpoint(playerid,120.403518, -294.375122, 1.578125, 3.0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not in the truck!");
}
return 1;
}
Re: Need small help for cmd -
Cxnnor - 29.06.2012
Can you tell me the actual problem? Like what is wrong with it
Re: Need small help for cmd -
Ironboy - 29.06.2012
Quote:
Originally Posted by Cxnnor
Can you tell me the actual problem? Like what is wrong with it
|
You didn't put bracket after SendClientMessage
pawn Код:
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not in the truck!");
It must be like this
pawn Код:
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not in the truck!");
}
Re: Need small help for cmd -
kaiks - 29.06.2012
Yup, thanks WagnerPm for clearing this out.
@Cxnnor, it was giving the player 5 messages about that he was not in the truck, when entering the truck.
All in all, it was a mess.