SA-MP Forums Archive
Script problem, Help. - 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: Script problem, Help. (/showthread.php?tid=258142)



Script problem, Help. - Brunok - 29.05.2011

Quote:

else if (strcmp("/reset", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 2032.0551,1343.7814,10.8203);
SendClientMessage(playerid, COLOR_WHITE, "Home sweet Home");
SetPlayerArmour(playerid, 0);
ResetPlayerWeapons(playerid);
}
}

If i typ /reset In-Game, it work's with all tings but it says after it ''Unknown Command'', It says it at several commands.

The first one is :
Quote:

if (strcmp("/schip", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,1515.5581,-1611.4160,892.9904);
SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to Schip T-DM, Choose a side.");
GivePlayerWeapon(playerid, 24, 100);
GivePlayerWeapon(playerid, 30, 500);
GivePlayerWeapon(playerid, 34, 50);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerHealth(playerid, 100);
}

This one works Perfect but it says too ''Unknown command'', And they can spam /schip and get free guns, How can i make it they can only can do one time /schip and if they exit the area they can do it again. If they are still in the DM Area they can't use commdands etc. Only if they use /reset... Help


Re: Script problem, Help. - Mike_Peterson - 29.05.2011

Код:
else if (strcmp("/reset", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 2032.0551,1343.7814,10.8203);
SendClientMessage(playerid, COLOR_WHITE, "Home sweet Home");
SetPlayerArmour(playerid, 0);
ResetPlayerWeapons(playerid);
return 1;
}
}  // what's up with this bracket??
Код:
if (strcmp("/schip", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,1515.5581,-1611.4160,892.9904);
SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to Schip T-DM, Choose a side.");
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 100);
GivePlayerWeapon(playerid, 30, 500);
GivePlayerWeapon(playerid, 34, 50);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerHealth(playerid, 100);
return 1;
}
try this?
edit: also try checking my tutorial, https://sampforum.blast.hk/showthread.php?tid=176688