invite Problem - 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:  invite Problem (
/showthread.php?tid=214021)
 
invite Problem - 
Deluxxe -  20.01.2011
It works not. Pls Help
pawn Код:
enum pInfo
{
    Money,
    Deaths,
    Kills,
    ServerTime,
    Skin,
    Leader,
    Team
}
 
pawn Код:
if (strcmp(cmd, "/invite", true)==0)
    {
        if(IsPlayerAdmin(playerid))
        {
        new tmp[256];
        new zielplayer,jobid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, white, "Benutze: /invite [ID] [JobID]");
            return 1;
        }
        zielplayer = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, white, "Benutze: /invite [ID] [JobID]");
            return 1;
        }
        jobid = strval(tmp);
        if(IsPlayerConnected(zielplayer))
        {
                beruf[zielplayer] = jobid;
                
                format(tmpstring,sizeof(tmpstring),"Der neue Job von %s ist %s",SetPlayerName(zielplayer),berufe[jobid]);
                SendClientMessage(playerid, white,tmpstring);
                format(tmpstring,sizeof(tmpstring),"Dein neuer Job ist %s",berufe[jobid]);
                SendClientMessage(zielplayer, white,tmpstring);
        } else {
            SendClientMessage(playerid, white,"Ungьltige SpielerID");
        }
        }
        return 1;
    }
 
AW: invite Problem - 
Nero_3D -  20.01.2011
Explain what happens if you type /invite
If you get a Unknown command! error than you arent rcon admin
Re: invite Problem - 
Deluxxe -  20.01.2011
It no Message ImGame. No Unknown command.
Re: invite Problem - 
WillyP -  20.01.2011
Before I say anything: Use sscanf + zcmd.
Re: invite Problem - 
Deluxxe -  20.01.2011
I can't not sscanf + zcmd.
sry my English is not god.
Re: invite Problem - 
HyperZ -  20.01.2011
Use 
sscanf and 
zcmd 
 
Command created with zcmd n sscanf:
pawn Код:
command(invite, playerid, params[])
{
    new ID, string[128];
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, white,"You need an admin to use this command.");
    if(sscanf(params, "ud", ID, jobid)) return SendClientMessage(playerid, white, "Benutze: /invite [ID] [JobID]");
    if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, white, "Ungьwhite SpielerID");
    beruf[ID] = jobid;
    format(string,sizeof(string),"Der neue Job von %s ist %s",SetPlayerName(ID),berufe[jobid]);
    SendClientMessage(playerid, white,string);
    format(string,sizeof(string),"Dein neuer Job ist %s",berufe[jobid]);
    SendClientMessage(ID, white,string);
    return 1;
}
 
Re: invite Problem - 
Deluxxe -  20.01.2011
Do I the everybody else commands to change ?
Thank you Clive