SA-MP Forums Archive
wrong script? rep+ - 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: wrong script? rep+ (/showthread.php?tid=414557)



wrong script? rep+ - icko202 - 09.02.2013

When i added this in my gamemode:

if(!strcmp(cmdtext, "/loadtruck"))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a truck from the depot.");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2428.7221679688, -2102.3930664063, 13.552991867065))
{
ShowPlayerDialog(playerid,13,DIALOG_STYLE_LIST,"Wh at do you want to load?","Clothes - 7.000$ \nWeapons - 9mm + 5.000$ \nEquipment - Armor + 5.500$ \nGas - 15.000$ \nPizza - 7.000$","Load","Cancel");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not at the loadplace.");
}
return 1;
}
return 0;
}

All of the commands in the gamemode stopped to work. How to fix it?


Re: wrong script? rep+ - MadafakaPro - 09.02.2013

Try this
pawn Код:
if(strcmp(cmdtext ,"/loadtruck",true) == 0)
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a truck from the depot.");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2428.7221679688, -2102.3930664063, 13.552991867065))
{
ShowPlayerDialog(playerid,13,DIALOG_STYLE_LIST,"Wh at do you want to load?","Clothes - 7.000$ \nWeapons - 9mm + 5.000$ \nEquipment - Armor + 5.500$ \nGas - 15.000$ \nPizza - 7.000$","Load","Cancel");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not at the loadplace.");
}
return 1;
}
return 0;
}



Re: wrong script? rep+ - icko202 - 09.02.2013

they wont work again .. i can give you my script if you want to see


Re: wrong script? rep+ - icko202 - 09.02.2013

the old code was:
if(!strcmp(cmdtext, "/loadtruck"))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a truck from the depot.");
IsPlayerInRangeOfPoint(playerid, 1, 2428.7221679688, -2102.3930664063, 13.552991867065);
{
ShowPlayerDialog(playerid,13,DIALOG_STYLE_LIST,"Wh at do you want to load?","Clothes - 7.000$ \nWeapons - 9mm + 5.000$ \nEquipment - Armor + 5.500$ \nGas - 15.000$ \nPizza - 7.000$","Load","Cancel");
}
return 1;
}
return 0;
}
and it all worked but if i type /loadtruck anywhere will show me the dialog.