Cp with command...
#1

Can someone tell me how to make a checkpoint that if someone is on it and write /robatm gets 1000$?
Reply
#2

Hmm, you could try it with IsPlayerInArea, but im not sure how it works...
Check the tutorial...
Reply
#3

Quote:
Originally Posted by Jeffry
Hmm, you could try it with IsPlayerInArea, but im not sure how it works...
Check the tutorial...
IsPlayerInCheckpoint..?
Reply
#4

Код:
public OnPlayerSpawn(playerid)
{
new atm=SetCheckpoint(playerid,x,y,z,sizeofcheckpoint); good size can be 2 to 8.
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/robatm", true, 7))
{ if(IsPlayerInCheckPoint(playerid)==1);
  GivePlayerMoney(playerid,1000); whatever amount you want
 return 1;
}
You can use OnplayerEnterCheckpoint too. Not sure but may work.
Reply
#5

better version of code above:

Ontop:
pawn Код:
new
  g_moneyCP;
OnPlayerSpawn:
pawn Код:
public OnPlayerSpawn(playerid)
{
  g_moneyCP = SetPlayerCheckpoint( playerid, x, y, z, size ); //I recommend size from 2.0-7.0
  return true;
}
Then the command:
pawn Код:
if( !strcmp( cmdtext, "/robatm", true ) )
{
  if( IsPlayerInCheckpoint( playerid ) == g_moneyCP )
    return GivePlayerMoney( playerid, 1000 );
  return false;
}

Reply
#6

Quote:
Originally Posted by lrZ^ aka LarzI
pawn Код:
if( IsPlayerInCheckpoint( playerid ) == g_moneyCP )
Are you sure this is going to work? Because i don't think it will.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)