03.03.2011, 13:21
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
printf("%d",checkpointid);
printf("%d",dcps[checkpointid]);
if(dcps[checkpointid] != 0)
{
printf("cp");
if(GetPlayerVehicleID(playerid) == tvid[playerid])
{
ShowPlayerDialog(playerid,34,DIALOG_STYLE_LIST,"Dealer:","Upgrades\nSell Vehicle\nLicense Plate\t$5000","Ok","Exit");
}
}
if(corg[checkpointid] != 0)
{
new q[128];
format(q,128,"SELECT * FROM orgs WHERE ID=%d",corg[checkpointid]);
mysql_query(q);
mysql_store_result();
mysql_fetch_row_format(q, "|");
new field[3][32];
explode(q,field,"|");
format(coname[checkpointid],32,"%s",field[1]);
mysql_free_result();
if(corg[checkpointid] != org[playerid])
{
new ss[128];
format(ss,128,"\n{E1E4AA}Organization:{FFFFFF}%s\n{E1E4AA}ID:{FFFFFF}%d",coname[checkpointid],corg[checkpointid]);
ShowPlayerDialog(playerid, 31,DIALOG_STYLE_MSGBOX,"Organization:",ss,"Ok","Cancel");
}
if(corg[checkpointid]==org[playerid])
{
new s[128];
format(s,128,"%s",oname[playerid]);
if(leader[playerid]!=1)
{
ShowPlayerDialog(playerid, 30, DIALOG_STYLE_LIST, s, "Members\nResign","Ok","Cancel");
}
else
{
ShowPlayerDialog(playerid, 30, DIALOG_STYLE_LIST, s, "Members","Ok","Cancel");
}
}
}
if(checkpointid == dcp[0])
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Welcome to driving school,", "1.Take Theory Test.\n2.Take Practical Test.", "ok","cancel");
}
if(checkpointid == bpickup)
{
ShowPlayerDialog(playerid,15,DIALOG_STYLE_LIST,"Welcome to the bank.\nWhat would you like to do today?", "General Banking\nCredit Cards","Ok","Cancel");
}
if(cpjob[checkpointid] != 0)
{
if(cpjob[checkpointid] != job[playerid])
{
new s[128],c[128];
format(c,128,"%s",cjname[checkpointid]);
format(s,128,"Do you want to work as a %s?",cjname[checkpointid]);
ShowPlayerDialog(playerid,28,DIALOG_STYLE_MSGBOX,c,s,"Yes","No");
tjcp[playerid]=checkpointid;
}
else
{
new s[128],c[128];
format(c,128,"%s",cjname[checkpointid]);
format(s,128,"Do you want to leave your job?",cjname[checkpointid]);
ShowPlayerDialog(playerid,29,DIALOG_STYLE_MSGBOX,c,s,"Yes","No");
}
}
if(shop[checkpointid]!=0)
{
new s[64];
format(s,sizeof(s),"%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d",clothes[shop[checkpointid]][0],clothes[shop[checkpointid]][1],clothes[shop[checkpointid]][2],clothes[shop[checkpointid]][3],clothes[shop[checkpointid]][4],clothes[shop[checkpointid]][5],clothes[shop[checkpointid]][6],clothes[shop[checkpointid]][7],clothes[shop[checkpointid]][8],clothes[shop[checkpointid]][9]);
ShowPlayerDialog(playerid,32,DIALOG_STYLE_LIST,"Clothes:",s,"Ok","Cancel");
strcp[playerid]=shop[checkpointid];
}
if(mycp[checkpointid] != 0)
{
ShowPlayerDialog(playerid,33,DIALOG_STYLE_LIST,"24-7:","Mobile\r$650","Ok","Cancel");
}
return 1;
}