Error help :3
#1

This code:

pawn Код:
CMD:slap(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[SLAP])
    {
        if(sscanf(params, "us[128]", playerid)) return SendClientMessage(playerid, grey, "Usage:/slap <id> <reason>");
        else
        {
            new pname[64], sc[128], playa, giveplayer, Float:slx, Float:sly, Float:slz;
            GetPlayerName(playa, giveplayer, sscanf(giveplayer));
            GetPlayerPos(playa, slx, sly, slz);
            SafeSetPlayerPos(playa, slx, sly, slz+8);
            //new targetlevel = gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[SLAP];
            //new playerlevel = gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[SLAP];
            format(sc, sscanf(sc), "AdmCmd:%s(%d) Was slapped by admin %s", pname);
            SendClientMessageToAll(COLOR_ORANGE, sc);
        }
    }
    return 1;
}
Gives this error.

pawn Код:
C:\Documents and Settings\d\Desktop\new.pwn(679) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\d\Desktop\new.pwn(684) : warning 202: number of arguments does not match definition
C:\Documents and Settings\d\Desktop\new.pwn(678) : warning 203: symbol is never used: "giveplayer"
C:\Documents and Settings\d\Desktop\new.pwn(1113) : error 021: symbol already defined: "strtok"
C:\Documents and Settings\d\Desktop\new.pwn(1128) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Please help :3
Reply
#2

I did this but i get 2 errors

pawn Код:
CMD:slap(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[SLAP])
    {
        if(sscanf(params, "us[128]", playerid)) return SendClientMessage(playerid, grey, "Usage:/slap <id> <reason>");
        else
        {
            new pname[64], sc[128], Float:slx, Float:sly, Float:slz;
            new giveplayer[128];
            GetPlayerName(playerid, giveplayer, sscanf(giveplayer));
            GetPlayerPos(playerid, slx, sly, slz);
            SafeSetPlayerPos(playerid, slx, sly, slz+8);
            //new targetlevel = gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[SLAP];
            //new playerlevel = gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[SLAP];
            format(sc, sscanf(sc), "AdmCmd:%s(%d) Was slapped by admin %s", pname);
            SendClientMessageToAll(COLOR_ORANGE, sc);
        }
    }
    return 1;
}
Reply
#3

Aight mate
Reply
#4

pawn Код:
CMD:slap(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[SLAP])
    {
        new
            pname[MAX_PLAYER_NAME],
            giveplayer[MAX_PLAYER_NAME],
            reason[64],
            playa,
            Float:slx,
            Float:sly,
            Float:slz,
            sc[128];

        if(sscanf(params, "us[128]", playa, reason))
            return SendClientMessage(playerid, grey, "Usage:/slap <id> <reason>");

        GetPlayerName(playa, giveplayer, sizeof(giverplayer);
           
        GetPlayerPos(playa, slx, sly, slz);
        SafeSetPlayerPos(playa, slx, sly, slz+8);

        format(sc, sizeof(sc), "AdmCmd: %s (%d) was slapped by admin %s (%d)", giveplayer, playa, pname, playerid);
        SendClientMessageToAll(COLOR_ORANGE, sc);
    }
    return 1;
}
Reply
#5

Thank you vince, but that didn't work :/

C:\Documents and Settings\d\Desktop\new.pwn(68 : error 017: undefined symbol "giverplayer"
C:\Documents and Settings\d\Desktop\new.pwn(1122) : error 021: symbol already defined: "strtok"
C:\Documents and Settings\d\Desktop\new.pwn(1137) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#6

Heres he fix

pawn Код:
CMD:slap(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[SLAP])
    {
        new pname[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME], reason[64], playa, Float:slx, Float:sly, Float:slz, sc[128];
        if(sscanf(params, "us[128]", playa, reason)) return SendClientMessage(playerid, grey, "Usage:/slap <id> <reason>");
        else
        {
            GetPlayerName(playa, giveplayer, sizeof(giveplayer));
            GetPlayerPos(playa, slx, sly, slz);
            SafeSetPlayerPos(playa, slx, sly, slz+8);
            format(sc, sizeof(sc), "AdmCmd: %s (%d) was slapped by admin %s (%d)", giveplayer, playa, pname, playerid);
            SendClientMessageToAll(COLOR_ORANGE, sc);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)