#1

pawn Код:
stock GivePlayerRobberyAmount(playerid, amount , stars, place)
{
    SetPlayerWantedLevel(playerid, stars);
    GivePlayerMoney(playerid, amount);
    return 1;
}
I Want to make something like you can see the playerid, the amount of cash , the stars and this is what i want :

place (as defined on stock) would be a string , how can i make that?

like
pawn Код:
stock GivePlayerRobberyAmount(playerid, amount, stars, place[])
{
       new place[250];
    SetPlayerWantedLevel(playerid, stars);
    GivePlayerMoney(playerid, amount);
    place = "Cluckin Bell"; // Example
    return 1;
}
Is this correct?
Reply
#2

Why the length 250 I believe there is no place with that too damn long name. 64 or even 32 are enough for a place name I guess.

Edit:

Oops
Check this

pawn Код:
// Somewhere you used GivePlayerRobberyAmount like this

GivePlayerRobberyAmount(playerid, 1000, 2, "Cluckin Bell");

// the stock
stock GivePlayerRobberyAmount(playerid, amount, stars, place[])
{
    SetPlayerWantedLevel(playerid, stars);
    GivePlayerMoney(playerid, amount);
    // Example to send a message to all that the place has been robbed with info
    new str[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(str, sizeof(str), "%s has stolen %d from %s and has %d stars now!", name, amount, place, stars);
    SendClientMessageToAll(-1, str);
    return 1;
}
Reply
#3

as for this line
pawn Код:
SetPlayerWantedLevel(playerid, stars);
you are setting his wanted level, what i suggest is
pawn Код:
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+stars);
to add wanted level not set it.
Reply
#4

Oh ye
Reply
#5

oh and

pawn Код:
C:\Users\Usuario\Desktop\Projects\CS\gamemodes\GTACNR.pwn(93) : error 010: invalid function or declaration
C:\Users\Usuario\Desktop\Projects\CS\gamemodes\GTACNR.pwn(1493) : error 035: argument type mismatch (argument 3)
pawn Код:
Line 93: Stock GivePlayerRobberyAmount(playerid, amount, stars, place[])

1493:  GivePlayerRobberyAmount(playerid, 1000, 2, "Cluckin Bell");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)