Server Help Needed - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Server Help Needed (
/showthread.php?tid=300041)
Server Help Needed -
RepzThat - 28.11.2011
For some reason, only Id's work in my server and not names. For example when I use /givecash it'll send that money to a random person in the server, not the person I typed. Its usually id 0, that it always gets sent to. However, when I use player ID'S instead of names, all of the cmds work perfectly fine. Its mostly with every command that uses a player name or id like /port, /setlevel and etc...
Anyone know how to fix this problem? Thanks
Re: Server Help Needed -
Nodroz - 28.11.2011
Could you provide us with that part of your script ?
Re: Server Help Needed -
RepzThat - 28.11.2011
Quote:
Originally Posted by Nodroz
Could you provide us with that part of your script ?
|
This is the code for /givecash:
Quote:
COMMAND:givecash(playerid, params[])
{
// Setup local variables
new Msg[128], Name[24], OtherName[24], OtherPlayer, Money;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/givecash", params);
{
|
This is the code for /port:
Quote:
SetPlayerPos(playerid, x, y, z);
// Let the player know about it
format(PortMsg, 128, "You have been ported to location: %4.2f, %4.2f, %4.2f", x, y, z);
SendClientMessage(playerid, 0x00FF00FF, PortMsg);
}
}
else
|
Code for /get:
Quote:
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/get <OtherPlayer>\"");
else
|
Also when I hosted the server on Windows it was working fine, however when I moved to Volt-Host (Linux) this the problem I got.
Re: Server Help Needed -
Nodroz - 28.11.2011
I guess you have have 2 times an openening tag.... (See the red)
Код:
COMMAND:givecash(playerid, params[])
{
// Setup local variables
new Msg[128], Name[24], OtherName[24], OtherPlayer, Money;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/givecash", params);
}
Oh, btw, I guess you forgot to add the other part of your script too...