Weird... PickUp Problem
#1

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid,x,y,z);
    new cash;
    cash = CreatePickup(1212,4,x,y,z,-1);
    return 1;
}
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == cash)
    {
        GivePlayerMoney(playerid,100);
    }
    return 1;
}
[CODE]cod5.pwn(83) : warning 204: symbol is assigned a value that is never used: "cash"
cod5.pwn(169) : error 017: undefined symbol "cash"[/PAWN]

I can't see anything wrong with the script, though :/
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=276222

This should help ya get it working ^^
Reply
#3

Declare the variable outside the function OnPlayerDeath.

Read about local and global variables: https://sampwiki.blast.hk/wiki/Scripting_Basics#local
Reply
#4

Thanks! +Rep!
Reply
#5

Quote:
Originally Posted by Tigerbeast11
View Post
Thanks! +Rep!
No Problem, Mate. Anytime
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)